package com.weixing.mall.provider.controller.rpc;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.provider.model.domain.MediaAdvertsing;
import com.weixing.mall.provider.model.enums.ads.AdvertsingEunm;
import com.weixing.mall.provider.service.IConfigService;
import com.weixing.mall.provider.service.IMediaAdvertsingService;
import com.weixing.mall.provider.service.IMediaPlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/*CMS 代办事项*/
@RestController
@RequestMapping("/api/agency")
public class AgencyRpcControllere extends BaseController {
    @Autowired
    private IMediaAdvertsingService mediaAdvertsingService;

    @Autowired
    private IMediaPlatformService mediaPlatformService;
    @Autowired
    private IConfigService sysConfigService;
    @GetMapping("media")
    public Map<String, Integer> agencyIndex(Long uid) {
        Map<String, Integer> tt = new HashMap<String, Integer>();
        List<MediaAdvertsing> list = mediaAdvertsingService.list(new QueryWrapper<MediaAdvertsing>().eq("staus", AdvertsingEunm.STATUS2.getValue()));
        tt.put("media", list.size());
        int t2 = mediaPlatformService.getPublic();
        tt.put("publicPool", t2);
        return tt;
    }
}

